<template>
	<view v-if='show'>
		<view class="main" v-if="IsMain">
			<view>
				<view class='items title'>
					<view style="color:#F9C05C;" v-for="(item ,index) in work" :key="index">{{item}}</view>
				</view>
			</view>
			<view style="margin-top: 80upx;">
				<view class='items' v-for="(item ,index) in list" :key="index">
					<view>{{item.profession.title}}</view>
					<view>{{item.expect_pay}}万韩元/天</view>
					<view>{{item.createtime}}</view>
				</view>
			</view>
		</view>
		<view v-if="IsNodate" class='nodate'>
			<view>暂无任何发布信息</view>
			<view class='torelease' @click="torelease">赶紧去发布~</view>
		</view>
	</view>
</template>

<script> 
	import api from '@/pages/utils/api.js';
	export default{
		data(){
			return {
				IsMain:false,
				IsNodate:false,
				show:false,//审核用
				list:[],
				work:['工种','期望薪资','时间']
			}
		},
		onLoad() {
			this.getIssueJobList();
		},
		onShow() {
			if(uni.getStorageSync('checked_status') == 1){
				uni.navigateTo({
					url: '/pages/index/checked'
				});
				return;
			};
			this.show=true
		},
		methods:{
			getIssueJobList:function(){
				var vm = this;
				api.getIssueJobList({
					 page:1,
					 pagesize:50
				}).then(info=>{ 
					if(info.code == 1 && info.data.length > 0){
						vm.list = info.data;
						vm.IsMain = true;
					}else{
						vm.IsNodate = true;
					}
				})
			},
			torelease:function(){
				uni.navigateTo({
					url: '/pages/release/index' 
				});
			}
		}
	}
</script>

<style>
	.nodate{
		margin: 20% auto;
		text-align: center;
		color: #444;
		font-size:32upx; 
	}
	.torelease{
		width: 80%;
		padding: 20upx;
		border-radius: 6upx;
		background: #F9C05C;
		color:#FFF;
		margin: 120upx auto 0 auto;
	}
	.title{
		width: 95%;
		position: fixed;
		top: 0;
		background: #FFF;
		box-shadow: 0px 0px 4upx 4upx #ccc;
		
	}
	.items{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20upx;
		border-bottom: #EEE solid 2upx;
		color:#444;
		font-size: 28upx;
	}
</style>
